﻿<!--#include file="include/Money_ratio.asp"-->
<!--#include file="include/conn_f.asp"-->
<!--#include file="top.asp"-->
<!--#include file="left.asp"-->
<%
class_1=left(SafeRequest("class",1),3)
select_currency = Left(GetSafeRequest("select_currency", 0, "USD"), 3)

If class_1<=1 Then
    class_1=1
End If
%>

<script language="javascript" type="text/javascript">
    $(document).ready(function () {
        $("select.currency").bind("change", function () {
            <%If UrlRewrite() = True Then%>
                window.location.href = "card_class_<%=class_1%>_" + $(this).val() + ".html";
            <%Else %>
                window.location.href = "card.asp?class=<%=class_1%>&select_currency=" + $(this).val();
            <%End If %>            
        });
    });
</script>

<div class="content">
<%
If class_1=1 Then 
%>

<script language="javascript" type="text/javascript">
    $(document).ready(function () {

        var tabs = $("#menu2 li a");
        var cats = $("table.category-table");

        tabs.bind("click", function () {

            cats.hide();
            cats.eq($(this).attr("tabindex")).show();
        });

    });
</script>
<!--#include file="include/category.asp"-->

<br />
<%
End If 
%>
<%
Dim tableName
If class_1<>1 Then 
    num=1
Else
    num=8
End If 
For j=1 To num 
    Select Case j
        Case 1 '热门游戏
            If class_1=1 Then 
                sql="select card_name,card_info_id,photo from card_infor where card_class="&class_1&" and"
                sql=sql&" card_info_id in (select card_infor_id from card_game where"
                sql=sql&" game_id in (select game_id from game where ishot=1 and isGame=1)) and onsale=1"
                sql=sql&" order by best desc,hot desc"
            Else
                sql="select card_name,card_info_id,photo from card_infor where card_class="&class_1&" and onsale=1"
            End If 
        Case 2	'abcd
            sql="select card_name,card_info_id,photo from card_infor where card_class="&class_1&" and"
            sql=sql&" card_info_id in (select card_infor_id from card_game where"
            sql=sql&" game_id in (select game_id from game where index_string in ('A','B','C','D') and isGame=1)) and onsale=1"
            sql=sql&" order by best desc,hot desc"
        Case 3	'efgh
            sql="select card_name,card_info_id,photo from card_infor where card_class="&class_1&" and"
            sql=sql&" card_info_id in (select card_infor_id from card_game where"
            sql=sql&" game_id in (select game_id from game where index_string in ('E','F','G','H') and isGame=1)) and onsale=1"
            sql=sql&" order by best desc,hot desc"
        Case 4	'ijkl
            sql="select card_name,card_info_id,photo from card_infor where card_class="&class_1&" and"
            sql=sql&" card_info_id in (select card_infor_id from card_game where"
            sql=sql&" game_id in (select game_id from game where index_string in ('I','J','K','L') and isGame=1)) and onsale=1"
            sql=sql&" order by best desc,hot desc"
        Case 5	'mnop
            sql="select card_name,card_info_id,photo from card_infor where card_class="&class_1&" and"
            sql=sql&" card_info_id in (select card_infor_id from card_game where"
            sql=sql&" game_id in (select game_id from game where index_string in ('M','N','O','P') and isGame=1)) and onsale=1"
            sql=sql&" order by best desc,hot desc"
        Case 6	'qrst
            sql="select card_name,card_info_id,photo from card_infor where card_class="&class_1&" and"
            sql=sql&" card_info_id in (select card_infor_id from card_game where"
            sql=sql&" game_id in (select game_id from game where index_string in ('Q','R','S','T') and isGame=1)) and onsale=1"
            sql=sql&" order by best desc,hot desc"
        Case 7	'wxyz
            sql="select card_name,card_info_id,photo from card_infor where card_class="&class_1&" and"
            sql=sql&" card_info_id in (select card_infor_id from card_game where"
            sql=sql&" game_id in (select game_id from game where index_string in ('W','X','Y','Z') and isGame=1)) and onsale=1"
            sql=sql&" order by best desc,hot desc"
        Case 8	'其它热门商品
            sql="select card_name,card_info_id,photo from card_infor where card_class="&class_1&" and"
            sql=sql&" card_info_id in (select card_infor_id from card_game where"
            sql=sql&" game_id in (select game_id from game where isGame=0)) and onsale=1"
            sql=sql&" order by best desc,hot desc"
    End Select 
%>
<table class="category-table" width="100%" border="0" cellspacing="2" cellpadding="0">
    <%
Dim goods_type



Set rs=server.CreateObject("ADODB.RecordSet")
rs.open sql,conn,1,1
If rs.eof And rs.bof Then 
    Response.Write "<tr><td align=""center"">暂无相关商品</td></tr>"
Else
    Do While Not rs.eof 

        Response.Write "<tr><td align=""center"" valign=""middle"" width=""120"">"
        Response.Write "<a href="""&MapUrl3("cardsell", "id", rs("card_info_id"), "select_currency", select_currency)&""" title="""&rs("card_name")&"""><img src=""photo/"&rs("photo")&""" border=""0"" width=""100"" alt="""&rs("card_name")&"""></a></td>"
        Response.Write "<td valign=""top"">"

            Response.Write "<table border=""0"" cellpadding=""2"" cellspacing=""1"" width=""100%"">"
            Response.Write "<tr><td>"
            Response.Write "<div class=""left""><Img src=""image/ico_1.jpg"" border=""0"">&nbsp;<a href="""&MapUrl3("cardsell", "id", rs("card_info_id"), "select_currency", select_currency)&""" title="""&rs("card_name")&""">"&rs("card_name")&"</a></div>"

            Response.Write "<div class=""right"">"

            Response.Write "<select class='currency'>"
            If select_currency="USD" Then
                Response.Write "<option value='USD' selected>美元</option>"
            Else
                Response.Write "<option value='USD'>美元</option>"
            End If
            If select_currency="CAD" Then
                Response.Write "<option value='CAD' selected>加元</option>"
            Else
                Response.Write "<option value='CAD'>加元</option>"
            End If
            If select_currency="GBP" Then
                Response.Write "<option value='GBP' selected>英磅</option>"
            Else
                Response.Write "<option value='GBP'>英磅</option>"
            End If
            If select_currency="EUR" Then
                Response.Write "<option value='EUR' selected>欧元</option>"
            Else
                Response.Write "<option value='EUR'>欧元</option>"
            End If
            If select_currency="AUD" Then
                Response.Write "<option value='AUD' selected>澳元</option>"
            Else
                Response.Write "<option value='AUD'>澳元</option>"
            End If
            If select_currency="JPY" Then
                Response.Write "<option value='JPY' selected>日元</option>"
            Else
                Response.Write "<option value='JPY'>日元</option>"
            End If
            If select_currency="SGD" Then
                Response.Write "<option value='SGD' selected>新元</option>"
            Else
                Response.Write "<option value='SGD'>新元</option>"
            End If
            If select_currency="CNY" Then
                Response.Write "<option value='CNY' selected>人民币</option>"
            Else
                Response.Write "<option value='CNY'>人民币</option>"
            End If
            Response.Write "</select>"

            Response.Write "</div>"
            Response.Write "</td></tr>"

            sql="select card_id,card_memo,goods_type,price,vip_price,miane from card where card_infor_id="&rs("card_info_id")
            sql=sql&" and onsale=1 order by price asc"
            Set tmp=server.CreateObject("ADODB.RecordSet")
            tmp.open sql,conn,1,1
            If tmp.eof And tmp.bof Then 
                
            Else
                Do While Not tmp.eof 
                    goods_type=""

                    '显示卡种类别
                    If Trim(tmp("goods_type"))=0 Then 
                        goods_type="卡密"
                    ElseIf Trim(tmp("goods_type"))=1 Then 
                        goods_type="直充"
                    ElseIf Trim(tmp("goods_type"))=3 Then 
                        goods_type="邮寄"
                    ElseIf Trim(tmp("goods_type"))=4 Then 
                        goods_type="扫描"
                    Else
                        goods_type="未知类型"
                    End If 

                    price=tmp("price")
                    vip_price=tmp("vip_price")
                    select case select_currency
                        case "USD"
                            price_cur=FormatNumber( price*BASE_RT/USD_RATIO,2 )&"&nbsp;美元"
                            price_vip_cur=FormatNumber( vip_price*BASE_RT/USD_RATIO,2 )&"&nbsp;美元"
                        case "CAD"
                            price_cur=FormatNumber( price*BASE_RT/CAD_RATIO,2 )&"&nbsp;加拿大元"
                            price_vip_cur=FormatNumber( vip_price*BASE_RT/CAD_RATIO,2 )&"&nbsp;加拿大元"
                        case "GBP"
                            price_cur=FormatNumber( price*BASE_RT/GBP_RATIO,2 )&"&nbsp;英磅" 
                            price_vip_cur=FormatNumber( vip_price*BASE_RT/GBP_RATIO,2 )&"&nbsp;英磅" 
                        case "EUR"
                            price_cur=FormatNumber( price*BASE_RT/EUR_RATIO,2 )&"&nbsp;欧元" 
                            price_vip_cur=FormatNumber( vip_price*BASE_RT/EUR_RATIO,2 )&"&nbsp;欧元" 
                        case "AUD"
                            price_cur=FormatNumber( price*BASE_RT/AUD_RATIO,2 )&"&nbsp;澳大利亚元" 
                            price_vip_cur=FormatNumber( vip_price*BASE_RT/AUD_RATIO,2 )&"&nbsp;澳大利亚元"
                        case "JPY"
                            price_cur=FormatNumber( price*BASE_RT/JPY_RATIO,2 )&"&nbsp;日元" 
                            price_vip_cur=FormatNumber( vip_price*BASE_RT/JPY_RATIO,2 )&"&nbsp;日元"
                        case "SGD"
                            price_cur=FormatNumber( price*BASE_RT/SGD_RATIO,2 )&"&nbsp;新加坡元" 
                            price_vip_cur=FormatNumber( vip_price*BASE_RT/SGD_RATIO,2 )&"&nbsp;新加坡元"
                        case "CNY"
                            price_cur=FormatNumber( price,2 )&"&nbsp;元" 
                            price_vip_cur=FormatNumber( vip_price,2 )&"&nbsp;元"
                        case Else
                            select_currency="USD"
                            price_cur=FormatNumber( price*BASE_RT/USD_RATIO,2 )&"&nbsp;美元"
                            price_vip_cur=FormatNumber( vip_price*BASE_RT/USD_RATIO,2 )&"&nbsp;美元"
                    end  Select

                    Response.Write "<tr><td bgcolor=""#EFF5FA"">"

                    Response.Write "<div>"&tmp("card_memo")&"(<font style=""color:#008000;"">"&goods_type&"</font>)"	
                    Response.Write "-"&tmp("miane")&"</div>"

                    Response.Write "<div>会员价：<font style=""color:#ff0000;"">"&price_cur&"</font>&nbsp;&nbsp;"

                    Response.Write "VIP价：<font style=""color:#ff0000;"">"&price_vip_cur&"</font>&nbsp;&nbsp;"

                    Response.Write "<a href="""&MapUrl3("order", "select_currency", select_currency, "card_id", tmp("card_id"))&""" title=""在线购买&nbsp;"&tmp("card_memo")&""" target=""""><font color='red'>购买&gt;&gt;</font></a></div>"

                    Response.Write "</td></tr>"
                    tmp.movenext
                    If tmp.eof Then Exit Do 
                Loop 
            End If 
            tmp.close
            Set tmp=Nothing 

            Response.Write "</table>"

        Response.Write "</td></tr>"
        Response.Write "<tr><td colspan=""2""><div style=""background-image:url('image/ico_2.jpg');background-repeat:repeat-x;"">&nbsp;</div></td></tr>"
        rs.movenext
        If rs.eof Then Exit Do 
    Loop 
End If 
rs.close
Set rs=Nothing 
    %>
</table>
<% Next %>

</div>
<!--#include file="bottom.asp"-->
